package com.itheima.pinda.log.entity;

import com.itheima.pinda.base.entity.SuperEntity;
import lombok.*;
import lombok.experimental.Accessors;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 登录日志DTO, 没有实体LoginLog中的 create_time 和 create_user 字段
 * </p>
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class LoginLogDTO extends SuperEntity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 操作IP
     */
    private String requestIp;

    /**
     * 登录人ID
     */
    private Long userId;

    /**
     * 登录人姓名
     */
    private String userName;

    /**
     * 登录人账号
     */
    private String account;

    /**
     * 登录描述
     */
    private String description;

    /**
     * 登录时间
     */
    private LocalDate loginDate;

    /**
     * 浏览器请求头
     */
    private String ua;

    /**
     * 浏览器名称
     */
    private String browser;

    /**
     * 浏览器版本
     */
    private String browserVersion;

    /**
     * 操作系统
     */
    private String operatingSystem;

    /**
     * 登录地点
     */
    private String location;


    @Builder
    public LoginLogDTO(Long id, LocalDateTime createTime, Long createUser,
                       String requestIp, Long userId, String userName, String account, String description,
                       LocalDate loginDate, String ua, String browser, String browserVersion, String operatingSystem, String location) {
        this.id = id;
        this.createTime = createTime;
        this.createUser = createUser;
        this.requestIp = requestIp;
        this.userId = userId;
        this.userName = userName;
        this.account = account;
        this.description = description;
        this.loginDate = loginDate;
        this.ua = ua;
        this.browser = browser;
        this.browserVersion = browserVersion;
        this.operatingSystem = operatingSystem;
        this.location = location;
    }

}
